import request from '@/utils/request'
import { data } from 'jquery'

// 搜索充值记录
export function searchChargeRecord(data) {
  return request({
    url: 'admin/charge-record/search',
    method: 'post',
    data
  })
}

// 搜索提现记录
export function searchUserWithdrawRecord(data) {
  return request({
    url: 'admin/user-withdraw-record/search',
    method: 'post',
    data
  })
}

// 搜索管理员用户
export function searchAdminUser(data) {
  return request({
    url: '/admin/admin-user/search',
    method: 'post',
    data
  })
}
// 修改管理员密码
export function modifyPassword(data) {
  return request({
    url: '/admin/admin-user/modify-password',
    method: 'put',
    data
  })
}

// 创建管理员用户
export function createAdminUser(data) {
  return request({
    url: '/admin/admin-user',
    method: 'post',
    data
  })
}

// 删除管理员用户
export function romoveAdminUser(data) {
  return request({
    url: '/admin/admin-user/remove-role',
    method: 'post',
    data
  })
}

// 重置管理员密码
export function resettingPassword(data) {
  return request({
    url: '/admin/admin-user/resetting-password',
    method: 'post',
    data
  })
}



// 搜索角色
export function searchRole(data) {
  return request({
    url: '/admin/role/search',
    method: 'post',
    data
  })
}

// 保存用户角色
export function saveAdminUserRoles(data) {
  return request({
    url: '/admin/role/save-roles',
    method: 'post',
    data
  })
}

// 所有角色
export function listRole() {
  return request({
    url: '/admin/role/list',
    method: 'post'
  })
}

// 创建角色
export function createRole(data) {
  return request({
    url: '/admin/role',
    method: 'post',
    data
  })
}

// 查询商家
export function searchUser(data) {
  return request({
    url: '/admin/user/search',
    method: 'post',
    data
  })
}

// 商家注册
export function registerUser(data) {
  return request({
    url: '/admin/user/register',
    method: 'post',
    data
  })
}

// 修改手续费
export function updateServiceUnitPrice(data) {
  return request({
    url: '/admin/user/update-service-unit-price',
    method: 'post',
    data
  })
}

// 修改用户信息
export function updateUserInfo(data) {
  return request({
    url: '/admin/user/update-user-info',
    method: 'post',
    data
  })
}

// 修改用户状态
export function updateUserSecurityStatus(data) {
  return request({
    url: '/admin/user/update-user-security-status',
    method: 'post',
    data
  })
}

// 开放关闭充值页面
export function updateOpenCharge(data) {
  return request({
    url: '/admin/user/update-open-charge',
    method: 'post',
    data
  })
}

// 开放安全付接口
export function updateOpenSafePay(data) {
  return request({
    url: '/admin/user/update-open-safe-pay',
    method: 'post',
    data
  })
}
// 开放开具发票接口
export function updateOpenInvoice(data) {
  return request({
    url: '/admin/user/update-open-invoice',
    method: 'post',
    data
  })
}
// 开放安全付收集到卡功能
export function updateOpenCollectionSafePay(data) {
  return request({
    url: '/admin/user/update-open-collection-safe-pay',
    method: 'post',
    data
  })
}

export function updateOpenSafePayOfflineCharge(data) {
  return request({
    url: '/admin/user/update-open-safe-pay-offline-charge',
    method: 'post',
    data
  })
}

// 开放鱼塘付接口
export function updateOpenAutoPay(data) {
  return request({
    url: '/admin/user/update-open-auto-pay',
    method: 'post',
    data
  })
}

// 开放安全发到卡接口
export function updateOpenSafePayBank(data) {
  return request({
    url: '/admin/user/update-open-safe-pay-bank',
    method: 'post',
    data
  })
}


// 鱼塘付转账记录
export function searchAutoPayTransBatch(data) {
  return request({
    url: '/admin/auto-pay-trans-batch/search',
    method: 'post',
    data
  })
}

// 开启安全发签约授权新方式
export function updateOpenSafePayNewSignMethod(data) {
  return request({
    url: '/admin/user/update-open-safe-pay-new-sign-method',
    method: 'post',
    data
  })
}
// 转账回调记录
export function searchChargeNotifyRecord(data) {
  return request({
    url: '/admin/charge-notify-record/search',
    method: 'post',
    data
  })
}

// 重试回调
export function initiateChargeNotify(data) {
  return request({
    url: '/admin/charge-notify-record/initiate',
    method: 'post',
    data
  })
}

// 安全付转账回调记录
export function searchSafePayBatchNotifyRecord(data) {
  return request({
    url: '/admin/safe-pay-batch-notify-record/search',
    method: 'post',
    data
  })
}

// 重试安全付转账回调
export function initiateSafePayBatchNotify(data) {
  return request({
    url: '/admin/safe-pay-batch-notify-record/initiate',
    method: 'post',
    data
  })
}

// 安全付转账回调记录
export function updateSafePayAccount(data) {
  return request({
    url: '/admin/safe-pay-book-account/update',
    method: 'post',
    data
  })
}


// 充值服务费回调记录
export function searchChargeRecordNotifyRecord(data) {
  return request({
    url: '/admin/charge-record-notify-record/search',
    method: 'post',
    data
  })
}

// 重试充值服务费回调
export function initiateChargeRecordNotifyRecord(data) {
  return request({
    url: '/admin/charge-record-notify-record/initiate',
    method: 'post',
    data
  })
}

// 手工充值
export function adminCharge(data) {
  return request({
    url: 'admin/charge-record/charge-by-admin',
    method: 'post',
    data
  })
}

//运营充值体验次数
export function chargeTransBatchByAdmin(data) {
  return request({
      url: '/admin/charge-record/charge-trans-batch-by-admin',
      method: 'post',
      data
  })
}

// 生成接口秘钥
export function createAppkey(params) {
  return request({
    url: 'admin/user/create-appkey',
    method: 'post',
    params
  })
}

// 查询合伙人
export function searchPartner(data) {
  return request({
    url: '/admin/partner/search',
    method: 'post',
    data
  })
}

// 合伙人注册
export function registerPartner(data) {
  return request({
    url: '/admin/partner/register',
    method: 'post',
    data
  })
}

// 修改合伙人分佣
export function updatePartnerBenefit(data) {
  return request({
    url: '/admin/partner/update-benefit',
    method: 'post',
    data
  })
}

// 修改二级合伙人分佣
export function updateLevel2PartnerBenefit(data) {
  return request({
    url: '/admin/partner/update-level2-benefit',
    method: 'post',
    data
  })
}

// 修改合伙人信息
export function updatePartnerInfo(data) {
  return request({
    url: '/admin/partner/update-partner-info',
    method: 'post',
    data
  })
}

// 修改用户状态
export function updatePartnerSecurityStatus(data) {
  return request({
    url: '/admin/partner/update-partner-security-status',
    method: 'post',
    data
  })
}

// 搜索转账批次
export function searchPayTransBatch(data) {
  return request({
    url: 'admin/pay-trans-batch/search',
    method: 'post',
    data
  })
}

// 搜索安全转账批次
export function searchSafePayBatch(data) {
  return request({
    url: 'admin/safe-pay-batch/search',
    method: 'post',
    data
  })
}

// 搜索合伙人收益统计
export function searchPartnerSettleRecord(data) {
  return request({
    url: 'admin/partner-settle-record/search',
    method: 'post',
    data
  })
}

// 搜索合伙人安全付收益统计
export function searchPartnerSafePaySettleRecord(data) {
  return request({
    url: 'admin/partner-safe-pay-settle-record/search',
    method: 'post',
    data
  })
}

// 搜索合伙人收益结算
export function searchPartnerSettleLog(data) {
  return request({
    url: 'admin/partner-settle-log/search',
    method: 'post',
    data
  })
}

// 搜索合伙人收益结算
export function searchPartnerSafePaySettleLog(data) {
  return request({
    url: 'admin/partner-safe-pay-settle-log/search',
    method: 'post',
    data
  })
}

// 搜索合伙人提现记录
export function searchPartnerWithdrawRecord(data) {
  return request({
    url: 'admin/partner-withdraw-record/search',
    method: 'post',
    data
  })
}

// 搜索合伙人批量提现记录
export function searchPartnerWithdrawRecordBatch(data) {
  return request({
    url: 'admin/partner-withdraw-record-batch/search',
    method: 'post',
    data
  })
}

// 合伙人批量提现打款--线下转账
export function ensureTransMoney(params) {
  return request({
    url: 'admin/partner-withdraw-record-batch/ensure',
    method: 'post',
    params
  })
}


// 搜索合伙人批量提现金额记录
export function sumPartnerWithdrawRecordBatchStat(data) {
  return request({
    url: 'admin/partner-withdraw-record/sum',
    method: 'post',
    data
  })
}
//转账统计看盘
export function sumTransStat(data) {
  return request({
    url: 'admin/trans-stat/sum',
    method: 'post',
    data
  })
}


// 转账
export function transPartnerWithdrawBatchRecordBatch(params) {
  return request({
    url: 'admin/partner-withdraw-record-batch//trans',
    method: 'post',
    params
  })
}

// 搜索转账统计
export function searchTransStat(data) {
  return request({
    url: '/admin/user-trans-stat/search',
    method: 'post',
    data
  })
}

// 搜索安全付转账统计
export function searchSafePayTransStat(data) {
  return request({
    url: '/admin/user-safe-pay-trans-stat/search',
    method: 'post',
    data
  })
}

// 搜索安全付月转账统计
export function searchSafePayTransMonthStat(data) {
  return request({
    url: '/admin/user-safe-pay-trans-month-stat/search',
    method: 'post',
    data
  })
}

// 安全付按月结算统计
export function statMonthBill(data) {
  return request({
    url: '/admin/user-safe-pay-trans-month-stat/stat-month-bill',
    method: 'post',
    data
  })
}



// 搜索日账单
export function searchCompanyBillDailyStat(data) {
  return request({
    url: '/admin/company-bill-daily-stat/search',
    method: 'post',
    data
  })
}

// 搜索日账单
export function sumCompanyBillDailyStat(data) {
  return request({
    url: '/admin/company-bill-daily-stat/sum',
    method: 'post',
    data
  })
}

// 搜索管理操作数据记录
export function searchOperationRecord(data) {
  return request({
    url: '/admin/operation-log/search',
    method: 'post',
    data
  })
}

// 获取所有admin用户操作的模块类别
export function listOperationRecordModule() {
  return request({
    url: '/admin/operation-log/list-operation-record-module',
    method: 'get'
  })
}

//登录用户
export function loginUser(params) {
  return request({
      url: '/admin/user/login',
      method: 'get',
      params
  })
}

//登录合伙人
export function loginPartner(params) {
  return request({
      url: '/admin/partner/login',
      method: 'get',
      params
  })
}

//查询网站配置
export function getSiteConfig() {
  return request({
      url: '/admin/site-config',
      method: 'get'
  })
}

//新增网站配置
export function addSiteConfig(data) {
  return request({
      url: '/admin/site-config',
      method: 'post',
      data
  })
}

//修改网站配置
export function updateSiteConfig(data) {
  return request({
      url: '/admin/site-config',
      method: 'put',
      data
  })
}

//修改网站配置
export function updeteChargeNotifyUrl(data) {
  return request({
      url: '/admin/user/update-user-charge-notify-url',
      method: 'put',
      data
  })
}

//取消单笔提现
export function cancelPartnerWithdrawRecord(params) {
  return request({
      url: '/admin/partner-withdraw-record/cancel',
      method: 'post',
      params
  })
}

//手动给合伙人提现
export function createPartnerWithdrawRecordBatch(data) {
  return request({
      url: '/admin/partner-withdraw-record-batch/create',
      method: 'post',
      data
  })
}

//取消合伙人提现批次
export function cancelPartnerWithdrawRecordBatch(params) {
  return request({
      url: '/admin/partner-withdraw-record-batch/cancel',
      method: 'post',
      params
  })
}

// 转账
export function transUserWithdrawRecord(id) {
  return request({
    url: 'admin/user-withdraw-record/trans',
    method: 'post',
    params: {id}
  })
}

//关闭转账
export function closeUserWithdraw(data) {
  return request({
    url: '/admin/user-withdraw-record/close',
    method: 'post',
    data
  })
}

//确认转账
export function confirmUserWithdraw(data) {
  return request({
    url: '/admin/user-withdraw-record/confirm',
    method: 'post',
    data
  })
}

//确认转账
export function getPartnerLastMonthSettleBenefit(data) {
  return request({
    url: '/admin/partner/get-last-month-settle-benefit',
    method: 'post',
    data
  })
}

//搜索安全发账本账户资质审核记录
export function searchSafePayBusinessAuthAuditRecord(data) {
  return request({
    url: '/admin/safe-pay-business-auth-audit-record/search',
    method: 'post',
    data
  })
}

//安全发账本账户资质审核通过
export function auditSuccess(id) {
  return request({
    url: '/admin/safe-pay-business-auth-audit-record/audit-success',
    method: 'post',
    params:{id}
  })
}

//安全发账本账户资质审核失败
export function auditFail(data) {
  return request({
    url: '/admin/safe-pay-business-auth-audit-record/audit-fail',
    method: 'post',
    data
  })
}

//搜索账户实名认证信息
export function searchUserBusinessAuth(data) {
  return request({
    url: '/admin/user-business-auth/search',
    method: 'post',
    data
  })
}

//账户实名认证审核通过
export function userBusinessAuditSuccess(id) {
  return request({
    url: '/admin/user-business-auth/audit-success',
    method: 'post',
    params:{id}
  })
}

//账户实名认证审核失败
export function userBusinessAuditFail(data) {
  return request({
    url: '/admin/user-business-auth/audit-fail',
    method: 'post',
    data
  })
}

//发票分页搜寻
export function searchInvoice(data) {
  return request({
    url: '/admin/invoice-administration/search',
    method: 'post',
    data
  })
}
//开具发票
export function openInvoice(data) {
  return request({
    url: '/admin/invoice-administration/open-invoice',
    method: 'post',
    data
  })
}
//开具发票失败
export function openInvoiceFail(data) {
  return request({
    url: '/admin/invoice-administration/open-invoice-fail',
    method: 'post',
    data
  })
}
//查询关联的充值记录
export function listRelatedChargeRecord(id) {
  return request({
    url: '/admin/invoice-administration/list-related-charge-record',
    method: 'post',
    params:{id}
  })
}

// 作废充值记录
export function cancelChargeRecord(data) {
  return request({
    url: '/admin/charge-record/cancel-charge-record',
    method: 'post',
    data
  })
}


// 安全发总余额查询
export function querySafePayBookTotalBalance() {
  return request({
    url: '/admin/safe-pay-book-account/query-safe-pay-book-total-balance',
    method: 'post',
  })
}

// 用户备案
export function submitUserRegistration(data) {
  return request({
    url: '/admin/user-registration/submit',
    method: 'post',
    data
  })
}

// 用户备案根据用户id查询
export function getByUserIdUserRegistration(data) {
  return request({
    url: '/admin/user-registration/get-by-user-id',
    method: 'post',
    data
  })
}
//记账本查询
export function querySafePayBook(bookId) {
  return request({
    url: '/admin/safe-pay-book-account/query-by-book-id',
    method: 'post',
    params: {
      bookId
    }
  })
}

//查询合伙人信息
export function getPartnerInfo(data) {
  return request({
    url: '/admin/partner/get-info',
    method: 'post',
    data
  })
}

/**
 * 获取验证码
 */
export function getModifyMobileCheckCode(mobile) {
  return request({
    url: '/common/check-code/modify-mobile',
    method: 'get',
    params: {
      mobile
    }
  })
}

//修改手机号
export function updateMobile(data) {
  return request({
    url: '/admin/user/update-mobile',
    method: 'post',
    data
  })
}

//搜索全局系统的配置
export function searchCommonSysConfig(data) {
  return request({
    url: '/admin/common-sys-config/search',
    method: 'post',
    data
  })
}

//新增全局系统的配置
export function saveCommonSysConfig(data) {
  return request({
    url: '/admin/common-sys-config/save',
    method: 'post',
    data
  })
}

//修改全局系统的配置
export function updateCommonSysConfig(data) {
  return request({
    url: '/admin/common-sys-config/update',
    method: 'post',
    data
  })
}


//合伙人换绑
export function userUpdatePartner(data) {
  return request({
    url: '/admin/user/update-partner',
    method: 'post',
    data
  })
}

//搜索开户申请记录
export function searchUserFilings(data) {
  return request({
      url: '/admin/partner-user-filings/search',
      method: 'post',
      data
  })
}

//开户审核通过
export function userFilingsAuditSuccess(data) {
  return request({
    url: '/admin/partner-user-filings/audit-success',
    method: 'post',
    data
  })
}

//开户审核拒绝
export function userFilingsAuditFail(data) {
  return request({
    url: '/admin/partner-user-filings/audit-fail',
    method: 'post',
    data
  })
}

//批量有密月转账统计
export function searchUserTransMonthStat(data) {
  return request({
    url: '/admin/user-trans-month-stat/search',
    method: 'post',
    data
  })
}

//后台经营数据统计
export function sumCompanyDailyStat(data) {
  return request({
    url: '/admin/company-daily-stat/sum',
    method: 'post',
    data
  })
}

//后台经营数据实时统计
export function selectCompanyRealTimeStat() {
  return request({
    url: '/admin/company-real-time-stat/select',
    method: 'post',
  })
}
//后台用户经营数据日统计
export function aggSearchUserDailyStat(data) {
  return request({
    url: '/admin/user-daily-stat/search',
    method: 'post',
    data
  })
}

//后台用户经营数据实时统计
export function aggSearchUserRealTimeStat(data) {
  return request({
    url: '/admin/user-real-time-stat/search',
    method: 'post',
    data
  })
}

//安全付备付金充值记录分页查询
export function searchSafePayBookAccountOrder(data) {
  return request({
    url: '/admin/safe-pay-book-account-order/search',
    method: 'post',
    data
  })
}

//安全付备付金充值记录分页查询
export function searchBookAccountLargeDepositChargeOrder(data) {
  return request({
    url: '/admin/safe-pay-book-account-large-deposit-charge-order/search',
    method: 'post',
    data
  })
}

//服务费明细查询
export function searchAccountLog(data) {
  return request({
    url: '/admin/account-log/search',
    method: 'post',
    data
  })
}

//服务费明细查询
export function searchPartnerInsiderSettleLog(data) {
  return request({
    url: '/admin/partner_insider_settle_log/search',
    method: 'post',
    data
  })
}

//查看秘钥
export function selectAppkey(data) {
  return request({
    url: '/admin/user/select-appkey',
    method: 'post',
    data
  })
}

//修改安全发实名认证信息
export function updateSafePayAccountInfo(data) {
  return request({
    url: '/admin/safe-pay-business-auth-audit-record/update-info',
    method: 'post',
    data
  })
}

//分页查询验证码
export function searchCheckCode(data) {
  return request({
    url: '/admin/check-code/search',
    method: 'post',
    data
  })
}


//服务费明细查询
export function aggSearchPartnerCombinationSettleRecord(data) {
  return request({
    url: '/admin/partner-combination-settle-record/agg-search',
    method: 'post',
    data
  })
}


//接口监控查询
export function aggSearchApiMonitor(data) {
  return request({
    url: '/admin/api-monitor/search',
    method: 'post',
    data
  })
}


//重置合伙人密码
export function resetPartnerPassword(data) {
  return request({
    url: '/admin/partner/reset-partner-password',
    method: 'post',
    data
  })
}


//分页查询操盘手信息
export function searchOperatorUser(data) {
  return request({
    url: '/admin/operation-user/search',
    method: 'post',
    data
  })
}

//冻结操盘手
export function updateOperatorUserSecurityStatus(data) {
  return request({
    url: '/admin/operation-user/update-status',
    method: 'post',
    data
  })
}

//重置操盘手密码
export function resetOperatorUserPassword(data) {
  return request({
    url: '/admin/operation-user/reset-password',
    method: 'post',
    data
  })
}

//分页查询操盘手操作记录信息
export function searchOperatorUserBindLog(data) {
  return request({
    url: '/admin/operation-user-bind-log/search',
    method: 'post',
    data
  })
}

//分页查询商户服务费日留存
export function searchUserAccountMoneyLeftStat(data) {
  return request({
    url: '/admin/user-account-money-left-stat/search',
    method: 'post',
    data
  })
}

export function sumUserAccountMoneyLeftStat(data) {
  return request({
    url: '/admin/user-account-money-left-stat/sum',
    method: 'post',
    data
  })
}


export function searchFrozenUserLog(data) {
  return request({
    url: '/admin/frozen-user-log/search',
    method: 'post',
    data
  })
}


export function searchSafePayBookPreApplyRecord(data) {
  return request({
    url: '/admin/safe-pay-book-pre-apply-record/search',
    method: 'post',
    data
  })
}

export function mountSafePayBookPreApplyRecord(data) {
  return request({
    url: '/admin/safe-pay-book-pre-apply-record/mount',
    method: 'post',
    data
  })
}


export function preApplySafePayBook(data) {
  return request({
    url: '/admin/safe-pay-book-pre-apply-record/apply',
    method: 'post',
    data
  })
}



//分页查询应用管理
export function searchOpenApp(data) {
  return request({
    url: '/admin/open-app/search',
    method: 'post',
    data
  })
}

//查看平台公钥
export function selectPublicAppkey(data) {
  return request({
    url: '/admin/open-app/select-appPublickey',
    method: 'post',
    data
  })
}

//修改应用管理
export function updateOpenApp(data) {
  return request({
    url: '/admin/open-app/update',
    method: 'post',
    data
  })
}

//修改应用管理ip白名单
export function updateOpenAppWhiteIps(data) {
  return request({
    url: '/admin/open-app/update-whiteIps',
    method: 'post',
    data
  })
}
//创建应用管理
export function saveOpenApp(data) {
  return request({
    url: '/admin/open-app/save',
    method: 'post',
    data
  })
}
//应用上线
export function openOpenApp(data) {
  return request({
    url: '/admin/open-app/open',
    method: 'post',
    data
  })
}
//应用下线
export function closedOpenApp(data) {
  return request({
    url: '/admin/open-app/closed',
    method: 'post',
    data
  })
}
//重置商户密码
export function resetUserPassword(data) {
  return request({
    url: '/admin/user/reset-password',
    method: 'post',
    data
  })
}
